package com.demo.rydemo.d_resource.service.impl;

import com.demo.rydemo.d_resource.entity.DResource;
import com.demo.rydemo.d_resource.mapper.DResourceMapper;
import com.demo.rydemo.d_resource.service.IDResourceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.Random;
import java.util.UUID;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ry
 * @since 2020-08-20
 */
@Service
public class DResourceServiceImpl extends ServiceImpl<DResourceMapper, DResource> implements IDResourceService {

    /**
     * 添加资源
     * @param dResource
     * @return
     */
    @Override
    public Boolean addRes(DResource dResource) {
        dResource.setResourceId(UUID.randomUUID().toString().replace("-",""));
        dResource.setCreateTime(new Date());

        return save(dResource);
    }
}
